<template>
	<view class="goods" :class="type == 2 ? 'yellow' : ''">
		<Ycqh v-if="item.release_type == 1" :item="item" :type="type"></Ycqh>
		<Yhqc v-if="item.release_type == 2" :item="item" :type="type"></Yhqc>
		<Hyxx v-if="item.release_type == 3" :item="item" :type="type"></Hyxx>
	</view>
</template>

<script>
	import Ycqh from './Transport/Ycqh.vue'
	import Yhqc from './Transport/Yhqc.vue'
	import Hyxx from './Transport/Hyxx.vue'
	import {
		ImageUrl,
		isBase64
	} from "@/common/public";
	import {
		IMAGE_URL
	} from '@/config/app'
	export default {
		props: {
			item: {
				type: Object,
				default: {},
			},
			type: {
				type: String | Number,
				default: '1',
			},
		},
		components: {
			Ycqh,
			Yhqc,
			Hyxx
		},
		computed: {
			toImages() {
				return (src) => {
					return isBase64(src) ? src : IMAGE_URL + src
				}
			},
			storeImages() {
				return (sum, images) => [images[0]]
			},
		},
		methods: {
			ImageUrl,
		}
	}
</script>

<style lang="scss" scoped>
	.goods {
		width: 90%;
		// box-shadow: 0 0 10px #ddd;
		// border-radius: 10px;
		// padding: 10px 12px;
		margin: 0 auto;
		margin-bottom: 20rpx;
		font-size: 30rpx;

		&.yellow {
			background: #fefcf6;
		}

		.price {
			color: #e71818 !important;
			font-size: 50rpx;

			.small {
				font-size: 30rpx;
				padding-left: 10rpx;
			}
		}

		.underline {
			border-bottom: 1rpx solid #ccc;
			padding-bottom: 10rpx;
		}

		.label {
			font-weight: 800;
			margin-bottom: 10rpx;
		}

		.text {
			color: #666;
			margin-top: 15rpx;
		}

		.lineP {
			margin: 20rpx 0 30rpx 0;
		}

		.flexImg {
			display: flex;
			align-items: stretch;
			flex-direction: row;
			justify-content: space-evenly;

			.imgFlex {
				flex: 1;
				margin-left: 10px;
				display: flex;
				flex-direction: column;
				justify-content: space-between;
			}
		}
	}
</style>